<template>
	<view>
		<view style="position: fixed; width: 100%; top: 0; padding-top: 20rpx; background-color: #F4F5F6; z-index: 2;">
			<uni-segmented-control style="width: calc(100% - 40rpx);" :current="current" :values="['未盘明细','已盘明细','异常明细']"
			 @clickItem="onClickItem" />
		</view>
		<view style="position: relative; margin-top: 90rpx;">
			<un-initial ref="unInitial" :checkId="checkId" v-show="current === 0" />
			<initialed ref="initialed" :checkId="checkId" v-show="current === 1" />
			<abnormal ref="abnormal" :checkId="checkId" v-show="current === 2" />
		</view>
	</view>
</template>

<script>
	import uniSegmentedControl from '@/components/uni-segmented-control/uni-segmented-control.vue';
	import unInitial from './replayUnInitial.vue';
	import initialed from './replayInitialed.vue';
	import abnormal from './replayAbnormal.vue';

	export default {
		components: {
			uniSegmentedControl,
			unInitial,
			initialed,
			abnormal
		},
		data() {
			return {
				current: 0,
				checkId: null
			}
		},
		onLoad(e) {
			this.checkId = e.id;
		},
		onPullDownRefresh() {
			if (this.current === 0) {
				this.$refs.unInitial.pullDownRefresh();
			} else if (this.current === 1) {
				this.$refs.initialed.pullDownRefresh();
			} else if (this.current === 2) {
				this.$refs.abnormal.pullDownRefresh();
			}
		},
		onReachBottom() {
			if (this.current === 0) {
				this.$refs.unInitial.reachBottom();
			} else if (this.current === 1) {
				this.$refs.initialed.reachBottom();
			} else if (this.current === 2) {
				this.$refs.abnormal.reachBottom();
			}
		},
		methods: {
			onClickItem(e) {
				this.current = e.currentIndex;
			}
		}
	}
</script>

<style>
</style>
